package com.ywger.integration.log;

/**
 * @author chenmeng
 * @date 2021-08-13 10:14
 * @desc
 */
public class CommonLogger {
    public static Object[] expand(String arg, Object... args) {
        if (args == null) {
            return new Object[]{arg, null};
        }
        if (args.length == 0) {
            return new Object[]{arg};
        } else {
            Object[] objects = new Object[args.length + 1];
            objects[0] = arg;
            System.arraycopy(args, 0, objects, 1, args.length);
            return objects;
        }
    }

    public static Object[] expand(String arg, String arg1, Object... args) {
        if (args == null) {
            return new Object[]{arg, arg1, null};
        }
        if (args.length == 0) {
            return new Object[]{arg, arg1};
        } else {
            Object[] objects = new Object[args.length + 2];
            objects[0] = arg;
            objects[1] = arg1;
            System.arraycopy(args, 0, objects, 2, args.length);
            return objects;
        }
    }
}
